package com.mbti.youmore.service;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.mbti.youmore.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
* @author Guqier
* @description 针对表【t_user】的数据库操作Service
* @createDate 2024-05-08 20:30:45
*/
public interface UserService extends IService<User> {

    User getUserByUsername(String username);

    User getUserByUserId(Integer userId);

    Map<String, Object> getUserByUserIdPlusFollow(Integer userId, Integer targetUserId) throws JsonProcessingException;

    List<User> getUserAll();

    @Transactional
        // 添加事务管理器注解
    boolean updateUser(User user);
    //    获取2积分方法
    User getIntegralOne(Integer UserId);
    //    获取5积分方法
    User getIntegralTwo(Integer UserId);
    ResponseEntity<?> signIn(int userId, Date lastTime);

    ResponseEntity<?> browseIn(int userId, Date lastTime);

//    ResponseEntity<?> postIn(int userId, Date lastTime);
}
